<template>
  <div class="app-container">
    <div class="topDiv">
      <div>
        <p class="title">
          <img src="@/assets/img/ptsz.png" alt style="height: 17px" />
          <!-- <img
            src="https://img0.baidu.com/it/u=384452397,1089369801&fm=26&fmt=auto&gp=0.jpg"
            alt
          /> -->
          <span>租户设置</span>
        </p>
        <el-tabs v-model="activeName" type="card" @tab-click="handleClick">
          <el-tab-pane label="基础设置" name="first">
            <el-form
              ref="elForm"
              :model="form"
              label-width="130px"
              style="margin-top: 20px"
              :rules="rules"
            >
              <el-row :gutter="10" style="margin: 0px auto; width: 65%">
                <el-col :span="15" :offset="2">
                  <el-form-item label="租户名称" prop="partnerName">
                    <el-input
                      v-model.trim="form.partnerName"
                      placeholder="请输入租户名称"
                      maxlength="20"
                      show-word-limit
                      clearable
                      class="inputWidth"
                    ></el-input>
                  </el-form-item>

                  <el-form-item label="进入模式配置" prop="field101">
                    <el-select
                      v-model="form.field101"
                      placeholder="请选择进入模式配置"
                      clearable
                      class="inputWidth"
                    >
                      <el-option
                        v-for="(item, index) in field101Options"
                        :key="index"
                        :label="item.label"
                        :value="item.value"
                        :disabled="item.disabled"
                      ></el-option>
                    </el-select>
                  </el-form-item>

                  <!-- <el-form-item label="默认费率设置" prop="field102">
                    <el-input
                      v-model.trim="form.field102"
                      placeholder="请输入默认费率设置"
                      clearable
                      maxlength="4"
                      show-word-limit
                      class="inputWidth"
                    >
                    </el-input>
                  </el-form-item> -->
                  <!-- <el-form-item label="提现账户设置" prop="field103">
                    <el-cascader
                      v-model="form.field103"
                      :options="field103Options"
                      :props="field103Props"
                      placeholder="点击查看"
                      class="inputWidth"
                    
                    ></el-cascader>
                  </el-form-item> -->

                  <el-form-item label="是否实名认证" prop="field104">
                    <el-select
                      class="inputWidth"
                      v-model="form.field104"
                      placeholder="请选择是否实名认证"
                      clearable
                    >
                      <el-option
                        v-for="(item, index) in Realame"
                        :key="index"
                        :label="item.label"
                        :value="item.value"
                        :disabled="item.disabled"
                      ></el-option>
                    </el-select>
                  </el-form-item>
                  <el-form-item label="租户LOGO">
                    <el-upload
                      class="upload-demo"
                      :action="actionUrl()"
                      :on-change="handleChange"
                      :on-remove="handleRemove"
                      :file-list="fileList"
                      :auto-upload="false"
                      accept=".jpg,.png,.jpeg,JPG,JPEG"
                      list-type="picture"
                    >
                      <el-button type="primary">点击上传</el-button>
                      <div slot="tip" class="el-upload__tip">
                        只能上传jpg/png文件，且不超过500kb
                      </div>
                    </el-upload>
                  </el-form-item>
                  <!-- <el-form-item label="租户简介">
                    <el-input
                      v-model.trim="form.partnerJianjie"
                      show-word-limit
                      placeholder="请输入租户简介"
                      maxlength="300"
                      clearable
                      class="inputWidth"
                    ></el-input>
                  </el-form-item> -->
                  <el-form-item label="租户状态">
                    <el-radio-group v-model="form.partnerState">
                      <el-radio :label="0">开启</el-radio>
                      <el-radio :label="1">关闭</el-radio>
                    </el-radio-group>
                  </el-form-item>

                  <!-- <el-form-item label="" v-show="form.partnerState=='1'"> -->
                  <div
                    v-show="form.partnerState == '1'"
                    style="width: 1000px; height: 450px"
                  >
                    <quill-editor
                      ref="text"
                      v-model="richText.PartnerContent"
                      style="height: 300px"
                      :options="editorOption"
                    >
                    </quill-editor>
                  </div>
                  <el-form-item label="提现状态">
                    <el-radio-group v-model="form.withdrawState">
                      <el-radio :label="0">开启</el-radio>
                      <el-radio :label="1">关闭</el-radio>
                    </el-radio-group>
                  </el-form-item>
                  <!-- <el-form-item label="" v-show="form.partnerState=='1'"> -->
                  <div
                    v-show="form.withdrawState == '1'"
                    style="width: 1000px; height: 450px"
                  >
                    <quill-editor
                      ref="text"
                      v-model="richText.withdrawContent"
                      style="height: 300px"
                      :options="editorOption"
                    >
                    </quill-editor>
                  </div>

                  <!-- </el-form-item> -->

                  <el-form-item label="是否开启层级关系">
                    <el-radio-group v-model="form.level">
                      <el-radio :label="0">开启</el-radio>
                      <el-radio :label="1">关闭</el-radio>
                    </el-radio-group>
                  </el-form-item>

                  <!-- <el-form-item label="后台风格设置1">
                    <el-select
                      class="inputWidth"
                      v-model="form.partnerStyleId"
                      placeholder="请选择后台风格"
                      clearable
                    >
                      <el-option label="风格一" value="shanghai"></el-option>
                      <el-option label="风格二" value="beijing"></el-option>
                    </el-select>
                  </el-form-item> -->
                  <el-form-item label="登录页背景图">
                    <el-upload
                      class="upload-demo"
                      :action="actionUrl()"
                      :on-change="handleChange1"
                      :on-remove="handleRemove1"
                      :file-list="fileList1"
                      :auto-upload="false"
                      list-type="picture"
                      accept=".jpg,.png,.jpeg,JPG,JPEG"
                    >
                      <el-button type="primary">点击上传</el-button>
                      <div slot="tip" class="el-upload__tip">
                        只能上传jpg/png文件，且不超过500kb
                      </div>
                    </el-upload>
                  </el-form-item>

                  <el-form-item label="后台登录地址">
                      <el-input
                        clearable
                        disabled
                        v-model.trim="url"
                   style="margin-right: 5px; width: 85%"
                      ></el-input>
                         <el-button
                      type="primary"  
                      class="btn"
                        :data-clipboard-text="url"
                        @click="copyLink2('.btn')"
                    >
                      复制
                    </el-button>
                  </el-form-item>

                  <!-- <el-form-item label="APP登录地址" prop="field110">
                    <template>
                      <el-input
                        clearable
                        disabled
                        v-model.trim="AppUrl"
                        style="margin-right: 5px; width: 85%"
                      ></el-input>
                         <el-button
                      type="primary"  
                        class="appbtn"
                        :data-clipboard-text="AppUrl"
                        @click="copyLink2('.appbtn')"
                    >
                      复制
                    </el-button>
                    
                     
                    </template>
                  </el-form-item> -->
                  <el-form-item label="">
                    <el-button
                      type="primary"
                      @click="submitForm"
                      style="width: 100px"
                      >确定</el-button
                    >
                  </el-form-item>
                </el-col>
              </el-row>
            </el-form>
          </el-tab-pane>

          <el-tab-pane label="APP样式设置" name="second">
            <div class="APP_Box" style="padding-bottom: 10vh">
              <div class="APP_Box_img">
                <div
                  v-for="(item, index) in imgurl"
                  :key="index"
                  class="APP_Box_img_box"
                >
                  <div class="titmeBox">
                    {{ item.name }}
                  </div>
                  <img :src="imgurl[index].src" alt="" class="poImg" />
                  <!-- <el-image
                    class="poImg"
                    :src="imgurl[index].src"
                    :preview-src-list="imgurl"
                  >
                  </el-image> -->
                  <div
                    style="
                      margin-top: 50px;
                      display: flex;
                      justify-content: center;
                      align-content: center;
                    "
                  >
                    <span style="margin: 0 auto; width: 50%">
                      <el-input
                        clearable
                        disabled
                        v-model.trim="item.url"
                        :id="item.id"
                        style="width:80%;margin-right:5px"
                      ></el-input>
                         <el-button
                      type="primary"  
                        :class="item.class"
                        :data-clipboard-text="item.url"
                        @click="copyLink2('.' + item.class)"
                    >
                      复制
                    </el-button>
                    </span>
                  </div>
                </div>
              </div>
              <div></div>
            </div>
          </el-tab-pane>
          <!-- 
          <el-tab-pane label="网络设置" name="third">
            <el-row style="margin-top: 50px; margin-bottom: 22vh">
              <el-col :span="4" :offset="8">
                <img
                  :src="require('../../../assets/images/basics3.png')"
                  alt=""
                />
              </el-col>
              <el-col :span="4" :offset="0">
                <img
                  :src="require('../../../assets/images/basics2.png')"
                  alt=""
                />
              </el-col>
            </el-row>
            <el-row style="margin: 50px 0px">
              <el-col :span="20" :offset="2" class="textData">
                <el-row>
                  <el-col :span="20" :offset="1"> 部署自有域名 </el-col>
                </el-row>
                <el-row style="display: flex; margin-top: 20px">
                  <el-col :span="20" class="colDiv" :offset="2">
                    将您的域名主机CNAME方式解析到
                    <br />
                    <el-input
                      v-model.trim="url"
                      maxlength="300"
                      clearable
                      show-word-limit
                      type="textarea"
                      id="link"
                      ref="link"
                      style="margin-bottom: 5px"
                    ></el-input>
                    <el-button
                      class="btn22"
                      type="primary"
                      @click="copyLink('.btn22')"
                      data-clipboard-action="copy"
                      data-clipboard-target="#link"
                    >
                      复制
                    </el-button>
                    　　
                  </el-col>
               
                </el-row>
              </el-col>
            </el-row>
          </el-tab-pane> -->

          <el-tab-pane label="关于我们" name="About">
            <div style="height: 70vh">
              <quill-editor
                ref="text"
                v-model="content"
                style="height: 550px; padding-bottom: 65px"
                :options="editorOption"
                @change="onEditorChange($event)"
              >
              </quill-editor>
              <span style="text-align: right; padding-top: 100px"
                >{{ TiLength }}/1700</span
              >
              <div>
                <el-button type="primary" @click="submitButton"
                  >确 定</el-button
                >
              </div>
            </div>
          </el-tab-pane>
          <el-tab-pane label="协议" name="protocol">
            <!-- tab-表格 -->
            <div style="margin: 20px 0px">
              <el-button type="primary" icon="el-icon-plus" @click="addProtocol"
                >新增协议</el-button
              >
              <div class="exportButton">
                <!-- <el-button
            icon="el-icon-upload2"
            @click="withdrawExport"
            style="margin-bottom: 10px; background: #f5f5f5"
            >导出</el-button
          > -->
              </div>
              <el-table
                :data="protocolDataList"
                v-loading="loading"
                style="margin-top: 10px"
                height="580"
                :header-cell-style="{
                  background: '#FAFAFA',
                  color: 'black',
                  'font-size': 15 + 'px',
                  'text-align': 'center',
                }"
              >
                <!-- <el-table-column type="selection" width="55" align="center" /> -->
                <el-table-column label="名称" prop="name" align="center" />
                <el-table-column label="分类" prop="type" align="center" />
                <el-table-column
                  label="内容"
                  prop="content"
                  align="center"
                  show-overflow-tooltip
                >
                  <template slot-scope="scope">
                    <span>{{ scope.row.content2 }}</span>
                  </template>
                </el-table-column>

                <el-table-column label="操作" align="center">
                  <template slot-scope="scope">
                    <el-button
                      size="mini"
                      type="text"
                      icon="el-icon-edit"
                      @click="editprotocolDataListBotton(scope.row)"
                      >编辑</el-button
                    >
                    <el-button
                      size="mini"
                      type="text"
                      icon="el-icon-delete"
                      @click="delProtocolDataListBotton(scope.row)"
                      >删除</el-button
                    >
                  </template>
                </el-table-column>
              </el-table>
            </div>
            <!-- 分页插件 -->
            <pagination
              :total="protocolF.total"
              :page.sync="protocolF.pageNum"
              :limit.sync="protocolF.pageSize"
              @pagination="protocolList"
              style="margin-bottom: 50px"
            />
          </el-tab-pane>
          <el-tab-pane label="版本管理" name="version">
            <!-- tab-表格 -->
            <div style="margin: 20px 0px">
              <el-button
                type="primary"
                icon="el-icon-plus"
                @click="addVersionShow"
                >新增版本</el-button
              >
              <div class="exportButton">
                <!-- <el-button
            icon="el-icon-upload2"
            @click="withdrawExport"
            style="margin-bottom: 10px; background: #f5f5f5"
            >导出</el-button
          > -->
              </div>
              <el-table
                :data="postList"
                v-loading="loading"
                style="margin-top: 10px"
                height="580"
                :header-cell-style="{
                  background: '#FAFAFA',
                  color: 'black',
                  'font-size': 15 + 'px',
                  'text-align': 'center',
                }"
              >
                <!-- <el-table-column type="selection" width="55" align="center" /> -->

                <el-table-column label="版本号" prop="version" align="center">
                  <template slot-scope="scope">
                    <span>{{ scope.row.version }}</span>
                  </template>
                </el-table-column>
                <el-table-column label="版本概述" prop="text" align="center" />
                <el-table-column label="分类" prop="type" align="center">
                  <template slot-scope="scope">
                    <span v-show="scope.row.type == 'Android'">安卓</span>
                    <span v-show="scope.row.type != 'Android'">{{
                      scope.row.type
                    }}</span>
                  </template>
                </el-table-column>
                <el-table-column
                  label="文件地址"
                  prop="versionUrl"
                  align="center"
                />
                <el-table-column label="操作" align="center">
                  <template slot-scope="scope">
                    <el-button
                      size="mini"
                      type="text"
                      icon="el-icon-edit"
                      @click="editVersionBotton(scope.row)"
                      >编辑</el-button
                    >
                    <el-button
                      size="mini"
                      type="text"
                      icon="el-icon-delete"
                      @click="delVersionData(scope.row)"
                      >删除</el-button
                    >
                  </template>
                </el-table-column>
              </el-table>
            </div>
            <!-- 分页插件 -->
            <pagination
              :total="queryParams.total"
              :page.sync="queryParams.pageNum"
              :limit.sync="queryParams.pageSize"
              @pagination="versionFinctin"
              style="margin-bottom: 50px"
            />
          </el-tab-pane>
        </el-tabs>
      </div>
    </div>
    <!-- 新增版本弹窗 -->
    <el-dialog
      :title="projectData.title"
      :visible.sync="projectDataSummary"
      width="30%"
      center
    >
      <el-form
        ref="projectData"
        :model="projectData"
        :rules="projectDatarules"
        size="medium"
        label-width="100px"
      >
        <!-- <el-form-item label="版本名称" prop="field101">
          <el-input
            maxlength="20"
            v-model.trim="projectData.field101"
            placeholder="请输入版本名称"
            clearable
            :style="{ width: '80%' }"
          >
          </el-input>
        </el-form-item> -->
        <el-form-item label="版本号" prop="field102">
          <el-input
            maxlength="20"
            v-model.trim="projectData.field102"
            placeholder="请输入版本号"
            clearable
            :style="{ width: '80%' }"
          >
          </el-input>
        </el-form-item>
        <el-form-item label="分类" prop="field103">
          <el-select
            v-model="projectData.field103"
            placeholder="请选择"
            clearable
            :style="{ width: '80%' }"
          >
            <el-option
              v-for="item in VersionOptions"
              :key="item.value"
              :label="item.label"
              :value="item.value"
            >
            </el-option>
          </el-select>
        </el-form-item>
        <el-form-item label="上传版本">
          <el-upload
            class="upload-demo"
            :action="actionUrl()"
            :on-change="VersionChang"
            :on-remove="VersionRemove"
            accept=".apk,.APK"
            :file-list="VersionChangList"
          >
            <el-button size="small" type="primary">点击上传</el-button>
            <div slot="tip" class="el-upload__tip">
              只能上传jpg/png文件，且不超过500kb
            </div>
          </el-upload>
          <!-- 
                    <el-upload
                      class="upload-demo"
                      :action="actionUrl()"
                      :on-change="handleChange1"
                      :on-remove="handleRemove1"
                      :file-list="fileList1"
                      :auto-upload="false"
                      list-type="picture"
                      accept=".jpg,.png,.jpeg,JPG,JPEG"
                    >
                    </el-upload> -->
        </el-form-item>
        <el-form-item label="版本概述">
          <el-input
            maxlength="200"
            v-model="projectData.field104"
            clearable
            type="textarea"
            show-word-limit
            :style="{ width: '80%' }"
          >
          </el-input>
        </el-form-item>
      </el-form>
      <div slot="footer">
        <el-button @click="projectDataSummary = false">取消</el-button>
        <el-button
          type="primary"
          @click="projectButton"
          :disabled="VersionButtonShow"
          >确定</el-button
        >
      </div>
    </el-dialog>
    <!-- 新增编辑协议弹窗 -->
    <el-dialog
      :title="protocolData.titme"
      :visible.sync="protocolDataSummary"
      width="50%"
      center
    >
      <el-form
        ref="protocolData"
        :model="protocolData"
        :rules="protocolDatarules"
        size="medium"
        label-width="100px"
      >
        <el-form-item label="名称" prop="field101">
          <el-input
            maxlength="20"
            v-model.trim="protocolData.field101"
            placeholder="请输入名称"
            clearable
            :style="{ width: '80%' }"
          >
          </el-input>
        </el-form-item>
        <el-form-item label="分类" prop="field102">
          <el-select
            v-model="protocolData.field102"
            placeholder="请选择"
            clearable
            :style="{ width: '80%' }"
          >
            <el-option
              v-for="item in protocolOptions"
              :key="item.value"
              :label="item.label"
              :value="item.value"
            >
            </el-option>
          </el-select>
        </el-form-item>
        <div style="height: 355px">
          <quill-editor
            ref="text"
            v-model="protocolContent"
            style="height: 370px; padding-bottom: 65px"
            :options="editorOption"
            @change="protocolChange($event)"
          >
          </quill-editor>
          <span style="text-align: right; padding-top: 100px"
            >{{ protocolTiLength }}/1700</span
          >
        </div>
      </el-form>
      <div slot="footer">
        <el-button @click="protocolDataSummary = false">取消</el-button>
        <el-button type="primary" @click="protocolButton">确定</el-button>
      </div>
    </el-dialog>
  </div>
</template>
<script>
import { quillEditor } from "vue-quill-editor";
import "quill/dist/quill.core.css";
import "quill/dist/quill.snow.css";
import "quill/dist/quill.bubble.css";
import Clipboard from "clipboard";
import {
  bankWkxxConfigList,
  CapWithdrawalRecordStaAPI,
  bankAPI,
  selectTenantExpenditureAccounts,
} from "@/api/finance/index.js";
import {
  upload,
  comnonConfig,
  getSetup,
  editAPI,
  selectByInvitationCodeIsUserId,
  AboutUs,
  AddAboutUs,
  EditAboutUs,
  addVersion,
  insertUserAgreement,
  selectUserAgreements,
  getSelectUserAgreement,
  editUserAgreement,
  deleteUserAgreement,
  selectSysVersionListPage,
  editVersion,
  delVersion,
} from "@/api/system/index.js";
export default {
  data() {
    return {
      protocolOptions: [
        { value: "租户协议", label: "租户协议" },
        { value: "平台服务协议", label: "平台服务协议" },
        { value: "提现协议", label: "提现协议" },
        { value: "免责声明", label: "免责声明" },
        { value: "平台租户协议", label: "平台租户协议" },
        { value: "新手引导", label: "新手引导" },
        { value: "常见问题", label: "常见问题" },
        { value: "提现手续费说明", label: "提现手续费说明" },
      ],

      //新增协议
      protocolDataList: [],
      protocolF: {
        total: 0,
        pageNum: 10,
        pageSize: 1,
      },
      protocolData: {
        field101: "",
        field102: "",
        field103: "",
        titme: "",
        id: "",
      },
      protocolDatarules: {
        field101: [
          {
            required: true,
            message: "请输入名称",
            trigger: "change",
          },
        ],
        field102: [
          {
            required: true,
            message: "请选择分类",
            trigger: "change",
          },
        ],
        field103: [
          {
            required: true,
            message: "请选择分类",
            trigger: "change",
          },
        ],
      },
      protocolDataSummary: false,
      protocolContent: "",
      protocolTiLength: "",
      richText: {
        PartnerContent: "", //租户状态
        withdrawContent: "", //提现状态
        TenantAgreement: "", //租户协议
        PlatformService: "", //平台服务协议
        withdrawAgreement: "", //提现协议
        DisclaimerContent: "", //免责声明
        PlatformTenant: "", //免责声明
      },
      //提现账户设置新参数测试
      WithdrawalAccount: [],
      //关于我们限制字数显示
      TiLength: "",
      //判断关于我们是新增还是修改
      judegWe: "",
      VersionOptions: [
        { label: "安卓", value: "Android" },
        { label: "ios", value: "ios" },
        // { label: "小程序", value: 3 },
      ],
      //新增版本按钮禁用
      VersionButtonShow: false,
      projectDataSummary: false,
      projectData: {
        field101: undefined,
        field102: undefined,
        field103: undefined,
        field104: undefined,
        field105: undefined,
        id: undefined,
      },
      projectDatarules: {
        // field101: [
        //   {
        //     required: true,
        //     message: "请输入模板名称",
        //     trigger: "change",
        //   },
        // ],
        field102: [
          {
            required: true,
            message: "请输入版本号",
            trigger: "change",
          },
        ],
        field103: [
          {
            required: true,
            message: "请选择分类",
            trigger: "change",
          },
        ],
      },
      //表格
      postList: [],
      total: "",
      // 查询参数
      queryParams: {
        pageNum: 1,
        pageSize: 10,
        total: 0,
      },
      //富文本框
      content: "",
      editorOption: {
        modules: {
          syntax: {
            highlight: (text) => hljs.highlightAuto(text).value,
          },
          toolbar: [
            ["bold", "italic", "underline", "strike"], // toggled buttons
            ["blockquote", "code-block"],

            [{ header: 1 }, { header: 2 }], // custom button values
            [{ list: "ordered" }, { list: "bullet" }],
            [{ script: "sub" }, { script: "super" }], // superscript/subscript
            [{ indent: "-1" }, { indent: "+1" }], // outdent/indent
            [{ direction: "rtl" }], // text direction

            [{ size: ["small", false, "large", "huge"] }], // custom dropdown
            [{ header: [1, 2, 3, 4, 5, 6, false] }],

            [{ color: [] }, { background: [] }], // dropdown with defaults from theme
            [{ font: [] }],
            [{ align: [] }],
            // ['link', 'image', 'video', 'formula']//去除video即可
            [], //去除video即可
          ],
        },
        placeholder: "编辑内容...",
      },
      isShow: false,
      word: "success",
      //自有的域名地址
      url: "",
      //APP登陆地址
      AppUrl: "",
      // 判断是新增还是修改 0是新增 1是修改
      Datacode: 0,
      rules: {
        field101: [
          {
            required: true,
            message: "请选择进入模式配置",
            trigger: "change",
          },
        ],
        partnerName: [
          {
            required: true,
            message: "请输入租户名称",
            trigger: "change",
          },
          {
            pattern: /^[a-zA-Z0-9\u4E00-\u9FA5]{2,20}$/,
            message: "名称格式错误",
            trigger: "change",
          },
        ],
        field110: [
          {
            pattern:
              /^([hH][tT]{2}[pP]:\/\/|[hH][tT]{2}[pP][sS]:\/\/)(([A-Za-z0-9-~]+)\.)+([A-Za-z0-9-~\/])+$/,
            message: "格式错误",
            trigger: "change",
          },
        ],
        field102: [
          {
            required: true,
            message: "请输入默认费率设置",
            trigger: "change",
          },
          {
            pattern:
              /(^[1-9]([0-9]+)?(\.[0-9]{1,2})?$)|(^(0){1}$)|(^[0-9]\.[0-9]([0-9])?$)/,
            message: "格式错误",
            trigger: "change",
          },
        ],
        field103: [
          {
            required: true,
            type: "array",
            message: "请至少选择一个",
            trigger: "change",
          },
        ],
        field104: [
          {
            required: true,
            message: "请选择进入模式配置",
            trigger: "change",
          },
        ],
        applogod: [
          {
            required: false,
            message: "请选择进入模式配置",
            trigger: "change",
          },
          {
            pattern:
              /(^[1-9]([0-9]+)?(\.[0-9]{1,2})?$)|(^(0){1}$)|(^[0-9]\.[0-9]([0-9])?$)/,
            message: "格式错误",
            trigger: "change",
          },
        ],
      },
      field101Options: [
        {
          label: "邀请码必填",
          value: 0,
        },
        {
          label: "邀请码选填",
          value: 1,
        },
        // {
        //   label: "邀请码不填",
        //   value: 2,
        // },
      ],
      Realame: [
        {
          label: "不实名",
          value: 0,
        },
        {
          label: "实名",
          value: 1,
        },
      ],
      field103Op: [],
      field103Options: [
        {
          label: "银联",
          value: 1,
          id: 100,
          children: [
            // {
            //   label: "选项一",
            //   value: "1",
            //   id: 101,
            // },
          ],
        },
        {
          label: "支付宝",
          value: 2,
          id: 103,
          children: [
            // {
            //   label: "支付宝",
            //   value: 0,
            //   id: 105,
            // },
          ],
        },
        {
          label: "记账本",
          value: 3,
          id: 103,
          children: [
            // {
            //   label: "选项一",
            //   value: 0,
            //   id: 104,
            // },
          ],
        },
      ],
      field103Props: {
        multiple: false,
      },

      radio: "",
      activeName: "first",
      input2: "first",

      form: {
        field101: undefined,
        field102: undefined,
        field103: [],
        field104: undefined,
        id: null,
        resource: "开启",
        adminLoginAddress: "", //后台登录地址
        appLoginAddress: "", //app后台登录地址
        loginBackground: 0, //登录背景图
        partnerJianjie: "", //租户简介
        partnerLogo: "", //租户logo
        partnerName: "", //租户名称
        partnerOffAddress: "", //租户地址关闭
        partnerOffWarn: "", //租户关闭提醒
        partnerState: 0, //租户状态
        partnerStyleId: 0, //后台风格
        userId: 0, //合伙人ID
        level: 0, //是否开启层级关系
        withdrawState: 0, //提现状态
      },
      fileList: [
        // {url:"",name:"logo"}
      ],
      fileList1: [
        //  {url:"",name:"background"}
      ],
      //新增版本上传
      VersionChangList: [],
      imgurl: [
        // {
        //   src: require("../../../assets/images/appbox.png"),
        //   url:"http://mm.91weiduan.cn/#/?invitationCode=",
        //   name:"完整版"
        // },
        // {
        //   src: require("../../../assets/images/appbox2.png"),
        //    url:"http://phone.91weiduan.cn/#/?invitationCode=",
        //    name:"简洁版"
        // },
      ],
      // 上传图片URL
      imgesLOGO: "",
      //登陆背景图URL
      bagkroundimges: "",
      userId: "",
      //邀请码
      Invitation: "",
      //网络设置里面的网络路径
      Network: "",
      //新增版本上传的保存文件
      VersionData: null,
      //新增版本上传返回的地址
      VersionDataUrl: null,
    };
  },
  async created() {
    const put = await getSetup();
    // //console.log(put,'888')
    // this.form.field103.push(put.data.withdrawalType - 0);
    // this.form.field103.push(put.data.withdrawalAccount);

    this.form.field103[0] = put.data.withdrawalType - 0;
    this.form.field103[1] = put.data.withdrawalAccount - 0;
  },
  async mounted() {
    const userID = sessionStorage.getItem("userID");
    this.userId = userID - 0;
    this.getData();
    this.AboutWe(); //关于我们
  },
  methods: {
    //后台登录地址复制
    urlTextButton() {
      let clipboard = new Clipboard(".btn");
      clipboard.on("success", (e) => {
        //  console.info("111",e)
        clipboard.destroy(); // 使用destroy可以清楚缓存
        this.$message({
          message: "复制成功！",
          type: "success",
        });
      });
      clipboard.on("error", (e) => {
        clipboard.destroy();
      });
    },
    //删除版本
    delVersionData(row) {
      this.$confirm("此操作将永久删除该文件, 是否继续?", "", {
        confirmButtonText: "确定",
        cancelButtonText: "取消",
        type: "warning",
      })
        .then(async () => {
          let param = {
            id: row.id,
          };
          // const delData=await delVersion(row.id);
          const delData = await delVersion(param);
          if (delData.code == 200) {
            this.$message({
              type: "success",
              message: "删除成功!",
            });
            this.versionFinctin();
          } else {
            this.$message.error(delData.msg);
          }
        })
        .catch(() => {
          this.$message({
            type: "info",
            message: "已取消删除",
          });
        });
    },
    //新增版本弹窗
    addVersionShow() {
      this.projectData = {
        field101: undefined,
        field102: undefined,
        field103: undefined,
        field104: undefined,
        field105: undefined,
        id: undefined,
        title: "",
      };
      this.VersionChangList = []; //上传版本清空
      this.projectDataSummary = true;
      this.VersionDataUrl = "";
      this.projectData.title = "新增";
    },
    //切换到版本管理
    async versionFinctin() {
      let param = {
        model: {
          // type: "", // 分类查询
          userId: this.userId - 0,
        },
        pageNum: this.queryParams.pageNum,
        pageSize: this.queryParams.pageSize,
      };
      const dataList = await selectSysVersionListPage(param);
      // //console.log(dataList, "版本");
      if (dataList.code == 200) {
        this.postList = dataList.data.list;
        this.queryParams.total = dataList.data.total;
      } else {
        this.$message.error(dataList.msg);
        this.postList = [];
      }
    },
    //编辑版本
    editVersionBotton(row) {
      this.projectData = {
        field102: row.version,
        field103: row.type,
        field104: row.text,
        id: row.id,
        title: "编辑",
      };
      this.VersionDataUrl = row.versionUrl;
      this.projectDataSummary = true;
    },
    //删除协议
    async delProtocolDataListBotton(row) {
      this.$confirm("此操作将永久删除该文件, 是否继续?", "", {
        confirmButtonText: "确定",
        cancelButtonText: "取消",
        type: "warning",
      })
        .then(async () => {
          const delData = await deleteUserAgreement(row.id);
          // //console.log(delData, "删除");
          if (delData.code == 200) {
            this.$message({
              type: "success",
              message: "删除成功!",
            });
            this.protocolList();
          } else {
            this.$message.error(editData.msg);
          }
        })
        .catch(() => {
          this.$message({
            type: "info",
            message: "已取消删除",
          });
        });
    },
    //新增协议
    addProtocol() {
      this.protocolData = {
        field101: "",
        field102: "",
        field103: "",
        titme: "",
        id: "",
      };
      this.protocolContent = "";
      this.protocolData.titme = "新增协议";
      this.protocolDataSummary = true;
    },
    //协议页面
    async protocolList() {
      let param = {
        // type:"新手引导",
        pageNum: this.protocolF.pageNum,
        pageSize: this.protocolF.pageSize,
      };

      const data = await selectUserAgreements(param);
      // //console.log(data, "6677");
      if (data.code == 200) {
        const regex = /<\/?.+?\/?>/gm;
        const subst = ``;
        data.data.map((item) => {
          item.content2 = item.content.replace(regex, subst);
        });
        this.protocolDataList = data.data;
      } else {
        this.$message.error(data.msg);
        this.protocolDataList = [];
      }
    },
    //协议编辑按钮
    async editprotocolDataListBotton(row) {
      //   this.protocolData= {
      //   field101: "",
      //   field102: "",
      //   field103: "",
      //    titme: "",
      //    id:""
      // };
      // //console.log(row, "543435543");
      this.protocolData.field101 = row.name;
      this.protocolData.field102 = row.type;
      this.protocolContent = row.content;
      this.protocolData.id = row.id;
      // const getData = await getSelectUserAgreement(row.id);
      // //console.log(getData, "543435543");
      // if (getData.code == 200) {
      //   this.protocolData.field101 = getData.data.name;
      //   this.protocolData.field102 = getData.data.type;
      //   this.protocolData.field103 = getData.data.content;
      //   this.protocolData.id = getData.data.id;
      // } else {
      //   this.$message.error(getData.msg);
      // }
      this.protocolData.titme = "编辑协议";
      this.protocolDataSummary = true;
    },
    //新增编辑协议提交按钮
    protocolButton() {
      this.$refs["protocolData"].validate(async (valid) => {
        if (valid) {
          // this.protocolData.field101  名称
          // this.protocolData.field102   分类
          // protocolContent    内容
          let param = {};
          if (this.protocolContent != "") {
            if (this.protocolData.id) {
              param = {
                content: this.protocolContent,
                name: this.protocolData.field101,
                type: this.protocolData.field102,
                id: this.protocolData.id,
              };
              const editData = await editUserAgreement(param);
              if (editData.code == 200) {
                this.$message({
                  type: "success",
                  message: "提交成功!",
                });
                this.protocolList();
                this.protocolDataSummary = false;
              } else {
                this.$message.error(editData.msg);
              }
            } else {
              param = {
                content: this.protocolContent,
                name: this.protocolData.field101,
                type: this.protocolData.field102,
              };
              const addData = await insertUserAgreement(param);
              // //console.log(addData, "新增");
              if (addData.code == 200) {
                this.$message({
                  type: "success",
                  message: "提交成功!",
                });
                this.protocolList();
                this.protocolDataSummary = false;
              } else {
                this.$message.error(addData.msg);
              }
            }
          } else {
            this.$message({
              message: "内容不可为空",
              type: "warning",
            });
          }
        }
        // TODO 提交表单
      });
    },
    //富文本字数限制
    onEditorChange(e) {
      e.quill.deleteText(1700, 4);
      if (this.form.intro == "") {
        this.TiLength = 0;
      } else {
        this.TiLength = e.quill.getLength() - 1;
      }
    },
    //富文本字数限制
    protocolChange(e) {
      e.quill.deleteText(1700, 4);
      if (this.protocolContent == "") {
        this.protocolTiLength = 0;
      } else {
        this.protocolTiLength = e.quill.getLength() - 1;
      }
    },
    //查询关于我们
    async AboutWe() {
      const data = await AboutUs({ userId: this.userId });
      // //console.log(data, "6666");
      if (data.code == 200) {
        if (data.rows.length <= 0) {
          this.judegWe = "新增";
        } else {
          this.judegWe = "修改";
          this.content = data.rows[0].text;
        }
      }
    },
    //新增版本提交按钮
    projectButton() {
      this.$refs["projectData"].validate(async (valid) => {
        if (valid) {
          setTimeout(() => {
            this.VersionButtonShow = false; //取消禁用按钮
          }, 5000);
          this.VersionButtonShow = true;
          if (this.VersionDataUrl) {
            this.projectButton2();
          } else {
            const uploadData = await upload(this.VersionData);
            // //console.log(uploadData, "222结果");
            if (uploadData.code == 200) {
              this.VersionDataUrl = uploadData.fileName;
              this.projectButton2();
            } else {
              this.$message.error(uploadData.msg);
            }
          }
        }
      });
    },

    async projectButton2() {
      let param = {};
      if (this.projectData.id) {
        param = {
          text: this.projectData.field104, //版本概述
          type: this.projectData.field103, //分类
          userId: this.userId - 0,
          version: this.projectData.field102, //版本号
          versionUrl: this.VersionDataUrl,
          id: this.projectData.id,
        };
        const data = await editVersion(param);
        if (data.code == 200) {
          this.$message({
            type: "success",
            message: "操作成功!",
          });
          this.versionFinctin();
          this.projectDataSummary = false;
          this.VersionButtonShow = false; //取消禁用按钮
        } else {
          this.$message.error(data.msg);
        }
      } else {
        param = {
          text: this.projectData.field104, //版本概述
          type: this.projectData.field103, //分类
          userId: this.userId - 0,
          version: this.projectData.field102, //版本号
          versionUrl: this.VersionDataUrl,
        };
        const data = await addVersion(param);
        if (data.code == 200) {
          this.$message({
            type: "success",
            message: "操作成功!",
          });
          this.versionFinctin();
          this.projectDataSummary = false;
          this.VersionButtonShow = false; //取消禁用按钮
        } else {
          this.$message.error(data.msg);
        }
      }
    },
    //富文本框确定按钮
    async submitButton() {
      if (this.content.length > 2000) {
        this.$message({
          message: "字数超出限制!",
          type: "warning",
        });
      } else {
        //  if(this.content.indexOf("")){

        //  }else{

        //  }
        let param = {
          text: this.content,
          userId: this.userId,
        };
        // //console.log(this.content, "888888888");
        if (this.judegWe == "新增") {
          const addData = await AddAboutUs(param);
          // //console.log(addData, "新增");
          if (addData.code == 200) {
            this.$message({
              message: "提交成功!",
              type: "success",
            });
            this.AboutWe();
          } else {
            this.$message.error("提交失败");
          }
        } else {
          const EditData = await EditAboutUs(param);
          // //console.log(EditData, "修改");
          if (EditData.code == 200) {
            this.$message({
              message: "提交成功!",
              type: "success",
            });
            this.AboutWe();
          } else {
            this.$message.error("提交失败");
          }
        }
        // //console.log(this.$refs.text.value);
        // //console.log(this.content, "677");
      }
    },
    //输入框复制
    copyLink(row) {
      // //console.log(row, "66");
      let clipboard = new Clipboard(row);
      clipboard.on("success", (e) => {
        this.isShow = true;
        this.word = "Success";
        setTimeout(() => {
          this.isShow = false;
        }, 500);
        clipboard.destroy(); // 使用destroy可以清楚缓存
        this.$message({
          message: "复制成功！",
          type: "success",
        });
      });
      clipboard.on("error", (e) => {
        this.word = "Fail";
        this.isShow = true;
        setTimeout(() => {
          this.isShow = false;
        }, 500);
        clipboard.destroy();
      });
    },
    //非输入框复制
    copyLink2(row) {
      // //console.log(row, "6677");
      let clipboard = new Clipboard(row)
      clipboard.on("success", (e) => {
        // //console.log(e, "6677888");
        clipboard.destroy(); // 使用destroy可以清楚缓存
        this.$message({
          message: "复制成功！",
          type: "success",
        });
      });
      clipboard.on("error", (e) => {
        clipboard.destroy();
      });
    },

    //app样式设置
    styleBotton() {
      // //console.log("app样式设置确定按钮");
      // //console.log(this.radio, "app样式设置确定按钮");
      let param = {
        sysCommonConfig: {
          appStyle: this.radio + "", //APP风格设置
          id: this.form.id, //是否属于新增  有ID就是修改 ，没有ID就是新增
        },
      };
      if (this.form.id) {
        let editParam = {
          appStyle: this.radio + "", //APP风格设置
          id: this.form.id, //是否属于新增  有ID就是修改 ，没有ID就是新增
        };
        // //console.log(editParam, "给后端传递的编辑参数");
        editAPI(editParam).then((res) => {
          // //console.log(res, "修改结果");
          if (res.code == 200) {
            this.$message({
              message: "提交成功",
              type: "success",
            });
            this.getData();
          } else {
            this.$message.error("提交失败");
          }
        });
      } else {
        comnonConfig(param).then((res) => {
          // //console.log(res, "提交结果");
          if (res.code == 200) {
            this.$message({
              message: "提交成功",
              type: "success",
            });
            this.getData();
          } else {
            this.$message.error("提交失败");
          }
        });
      }
    },

    async getData() {
      //获取邀请码
      const yqm = await selectByInvitationCodeIsUserId();
      // //console.log(yqm, "获取邀请码");
      this.Invitation = yqm.msg;
      // app样式设置
      this.imgurl = [
        {
          src: require("../../../assets/images/appbox.png"),
          url: "http://mm.91weiduan.cn/#/?invitationCode=" + yqm.msg,
          name: "完整版",
          id: "appurl1",
          class: "appbt1",
        },
        {
          src: require("../../../assets/images/appbox2.png"),
          url: "http://phone.91weiduan.cn/#/?invitationCode=" + yqm.msg,
          name: "简洁版",
          id: "appurl2",
          class: "appbt2",
        },
      ];
      let param = {};
      //   { label: "支付宝", value: "ALIPAY" },
      // { label: "银联", value: "WUKONG" },
      // { label: "支付宝记账本", value: "ALIPAYACCOUNTBOOK" },
      param = {
        tenantId: this.userId,
        signAccountType: "ALIPAY", //这个根据类型搜索
      };
      const alipayData = await selectTenantExpenditureAccounts(param);
      // //console.log(alipayData, "支付宝");
      if (alipayData.code == 200) {
        if (alipayData.data.length > 0) {
          this.field103Options[1].children = alipayData.data.map((item) => {
            return {
              label: item.accountName,
              value: item.id,
              id: item.id,
            };
          });
        }
      } else {
        this.field103Options[1].children = [];
      }

      param = {
        tenantId: this.userId,
        signAccountType: "WUKONG", //这个根据类型搜索
      };
      const bankData = await selectTenantExpenditureAccounts(param);
      // //console.log(bankData, "银联");
      if (bankData.code == 200) {
        if (bankData.data.length > 0) {
          this.field103Options[0].children = bankData.data.map((item) => {
            return {
              label: item.accountName,
              value: item.id,
              id: item.id,
            };
          });
        }
      } else {
        this.field103Options[0].children = [];
      }
      param = {
        tenantId: this.userId,
        signAccountType: "ALIPAYACCOUNTBOOK", //这个根据类型搜索
      };
      const alipayDataBook = await selectTenantExpenditureAccounts(param);
      // //console.log(alipayDataBook, "记账本");
      if (alipayDataBook.code == 200) {
        if (alipayDataBook.data.length > 0) {
          this.field103Options[2].children = alipayDataBook.data.map((item) => {
            return {
              label: item.accountName,
              value: item.id,
              id: item.id,
            };
          });
        }
      } else {
        this.field103Options[2].children = [];
      }

      //获取本机的URL
      // //console.log(this.$route.path);
      // //console.log(window.location.href);

      const { data } = await getSetup();
      // //console.log(data, "获取基础设置");

      this.form.partnerName = data.appName || "管理系统"; //租户名称
      this.form.id = data.id; //判断是修改还是新增的ID
      this.radio = data.appStyle - 0 || 1; //APP样式设置
      this.form.field101 = data.intoPattern ; //邀请码
      // 0 邀请码必填 1 邀请码选填 2 邀请码不填
      this.form.field102 = data.defaultRate || 0; //默认费率

      //      this.WithdrawalAccount[0] = data.withdrawalType - 0; //提现账户设置
      // this.WithdrawalAccount[1] = data.withdrawalAccount-0 ; //提现账户设置

      //vue如何监听数组索引,其实在页面一进来就已经赋值了，去created生命周期看看就知道了
      this.form.field103[0] = data.withdrawalType - 0;
      this.form.field103[1] = data.withdrawalAccount - 0;

      //  this.$set(this.form.field103,tt,tt2);
      // //console.log(this.form.field103, "提现账户设置的参数");

      this.form.field104 = data.realNameAuth || 0; //是否实名

      // 0 选择实名 1 必须实名
      this.form.partnerJianjie = data.appNotes; //租户简介
      this.form.partnerState = data.appState || 0; //租户状态
      this.form.level = data.enabledLevel || 0; //是否开启层级关系
      this.form.partnerStyleId = data.appStyle || 0; //后台风格设置
      this.form.appLoginAddress = data.appLoginAddress; //APP后台登录地址
      this.form.adminLoginAddress = data.adminLoginAddress; //后台登录地址

      this.form.withdrawState = data.withdrawalState; //提现状态 0开启  1关闭
      this.richText.withdrawContent = data.withdrawalDisenableContent; //提现状态关闭富文本
      this.richText.PartnerContent = data.appDisenableContent; //租户状态关闭富文本
      //

      if (data.adminLoginAddress) {
        this.Network = data.adminLoginAddress;
      } else {
        this.Network = "http://" + window.location.host;
        // //console.log(window.location.host, "999");
      }
      this.fileList1 = [];
      this.fileList = [];
      if (data.appLogoUrl != "" || data.appLogoUrl != null) {
        this.fileList.push({ url: data.appLogoUrl, name: "logoname" }); // 租户LOGO
      }
      if (
        data.loginBackgroundImageUrl != "" ||
        data.loginBackgroundImageUrl != null
      ) {
        this.fileList1.push({
          url: data.loginBackgroundImageUrl,
          name: "background",
        }); // 登录页背景图
      }
      //自有域名
      // this.url = `${this.Network}/login?redirect=%2Findex&yqm=${this.Invitation}`;
      this.url = `${this.$root.baseUrl}/login?redirect=%2Findex&yqm=${this.Invitation}`;
      this.AppUrl = `http://mm.91weiduan.cn/#/?invitationCode=${this.Invitation}`;
    },
    // 基础设置确定按钮
    submitForm() {
      // //console.log(this.form.field103,'提现账户设置的参数')
      this.$refs["elForm"].validate((valid) => {
        if (valid) {
          // //console.log(this.form.field103, "555444");
          if (this.form.field103[0] == "" || this.form.field103[1] == "") {
            this.$message({
              message: "提现账户设置不可为空",
              type: "warning",
            });
          } else {
            let param = {
              sysCommonConfig: {
                appLogoUrl: this.imgesLOGO, //平台LOGO
                loginBackgroundImageUrl: this.bagkroundimges, //背景LOGO
                // userId: this.userId, //用户id
                intoPattern: this.form.field101, //邀请码
                appName: this.form.partnerName, //租户名称
                defaultRate: this.form.field102, //默认费率
                // withdrawalAccount: this.form.field103[1] + "", //提现账户设置
                realNameAuth: this.form.field104, //是否实名
                appNotes: this.form.partnerJianjie, //租户简介
                appState: this.form.partnerState, //租户状态 0开启  1关闭
                enabledLevel: this.form.level, //是否开启层级关系
                adminStyle: this.form.partnerStyleId, //后台风格设置
                appLoginAddress: this.form.partnerStyleId, //app后台登录地址
                adminLoginAddress: this.form.adminLoginAddress, //后台登录地址
                // withdrawalType: this.form.field103[0] + "", //提现类型  0记账本 1银联 2支付宝
                withdrawalState: this.form.withdrawState, //提现状态 0开启  1关闭
                withdrawalDisenableContent: this.richText.withdrawContent, //提现状态关闭富文本
                appDisenableContent: this.richText.PartnerContent, //租户状态关闭富文本
              },
            };
            // //console.log(param, "给后端传递的参数");
            if (this.form.id) {
              let editParam = {
                // userId: this.userId, //用户id
                intoPattern: this.form.field101, //邀请码
                appName: this.form.partnerName, //租户名称
                defaultRate: this.form.field102, //默认费率
                // withdrawalAccount: this.form.field103[1], //提现账户设置
                realNameAuth: this.form.field104, //是否实名
                appNotes: this.form.partnerJianjie, //租户简介
                appState: this.form.partnerState, //租户状态
                enabledLevel: this.form.level, //是否开启层级关系
                adminStyle: this.form.partnerStyleId, //后台风格设置
                id: this.form.id, //是否属于新增  有ID就是修改 ，没有ID就是新增
                // appLoginAddress: this.form.appLoginAddress, //app后台登录地址
                // adminLoginAddress: this.form.adminLoginAddress, //后台登录地址

                // withdrawalType: this.form.field103[0] + "", //提现类型  3记账本 1银联 2支付宝
                withdrawalState: this.form.withdrawState, //提现状态 0开启  1关闭
                withdrawalDisenableContent: this.richText.withdrawContent, //提现状态关闭富文本
                appDisenableContent: this.richText.PartnerContent, //租户状态关闭富文本
              };

              if (this.imgesLOGO != "") {
                editParam.appLogoUrl = this.imgesLOGO;
              }
              if (this.bagkroundimges != "") {
                editParam.loginBackgroundImageUrl = this.bagkroundimges;
              }
              editAPI(editParam).then((res) => {
                // //console.log(res, "修改结果");
                if (res.code == 200) {
                  this.$message({
                    message: "提交成功,需重新登录生效",
                    type: "success",
                  });
                  this.getData();
                } else {
                  this.$message.error("提交失败");
                }
              });
            } else {
              comnonConfig(param).then((res) => {
                // //console.log(res, "提交结果");
                if (res.code == 200) {
                  this.$message({
                    message: "提交成功,需重新登录生效",
                    type: "success",
                  });
                  this.getData();
                } else {
                  this.$message.error("提交失败");
                }
              });
            }
          }
        }
        // TODO 提交表单
      });
    },

    actionUrl() {
      return "";
    },
    // 租户LOGO上传图片
    handleChange(file, fileList) {
      if (this.fileList.length >= 0) {
        this.fileList = [];
      }
      this.fileList.push(file);

      // //console.log(file, "1111");

      let formData = new FormData();
      // formData.append("avatarfile", file.raw);
      formData.append("file", file.raw);

      upload(formData).then((data) => {
        // //console.log(data, "222");
        // this.imgesLOGO = data.url;
        // this.imgesLOGO = "http://mao.91weiduan.cn"+data.fileName;
        this.imgesLOGO = this.$situation.dizhi + data.fileName;
        // this.form.partnerLogo = data.imgUrl;
      });
    },
    // 取消图片的函数
    handleRemove(file, fileList) {
      // this.imgesLOGO = "http://192.168.31.130/static/img/profile.473f5971.jpg";
      this.imgesLOGO = "";
      this.fileList = [];
    },
    // 登录页背景图上传图片
    handleChange1(file, fileList) {
      if (this.fileList1.length >= 0) {
        this.fileList1 = [];
      }
      this.fileList1.push(file);

      // //console.log(file, "1111");

      let formData = new FormData();

      // formData.append("avatarfile", file.raw);
      formData.append("file", file.raw);

      // //console.log(this.fileList1, "333");

      upload(formData).then((data) => {
        // //console.log(data, "222");
        // this.bagkroundimges = data.url;
        // this.bagkroundimges = "http://mao.91weiduan.cn"+data.fileName;
        this.bagkroundimges = this.$situation.dizhi + data.fileName;
        // this.form.partnerLogo = data.imgUrl;
      });
    },
    // 新增版本上传
    VersionChang(file, fileList) {
      if (this.VersionChangList.length >= 1) {
        this.VersionChangList = [];
      }
      this.VersionChangList.push(file);

      // //console.log(file, "1111");

      let formData = new FormData();

      // formData.append("avatarfile", file.raw);
      formData.append("file", file.raw);

      // //console.log(this.VersionChangList, "333");
      this.VersionData = formData;
    },
    // 取消图片的函数
    VersionRemove(file, fileList) {
      this.VersionChangList = [];
    },
    // 取消图片的函数
    handleRemove1(file, fileList) {
      // this.bagkroundimges ="http://121.40.114.220/wp-content/uploads/2016/09/yiduoyun.jpg";
      this.bagkroundimges = "";
      this.fileList1 = [];
    },

    handleClick(tab, event) {
      // //console.log(tab, event);
      if (tab.name == "protocol") {
        this.protocolList();
      } else if (tab.name == "version") {
        this.versionFinctin();
      }
    },
    applicationForm() {
      let _this = this;
      let clipboardEl = new clipboard(".applicationFormNum"); // 类名
      clipboardEl.on("success", function (e) {
        _this.$message({
          message: "复制成功",
          type: "success",
        });
        clipboardEl.destroy();
      });
      clipboardEl.on("error", function (e) {
        _this.$message.error("复制失败");
        clipboardEl.destroy();
      });
    },
  },
  watch: {
    // form:{
    //     deep:true,
    //     handler:function(newVal,oldVal){
    //          //console.log(newVal,'1111')
    //     //console.log(oldVal,'2222')
    //     }
    // }
  },
  components: {
    quillEditor,
  },
};
</script>
<style scoped lang="scss">
//APP样式设置
.APP_Box {
  // border: 1px red solid;
  display: flex;
  flex-direction: column;
  .APP_Box_img {
    margin-top: 10px;
    display: flex;
    justify-content: space-evenly;
    .APP_Box_img_box {
      width: 50%;
      // border: 1px red solid;
      .titmeBox {
        display: flex;
        justify-content: center;
        align-content: center;
        margin-bottom: 10px;
      }
      .poImg {
        height: 550px;
        width: 340px;
        display: flex;
        justify-content: space-evenly;
        // border: 1px red solid;
        margin: 0 auto;
      }
    }
  }
}
//弹窗在屏幕中间
::v-deep .el-dialog__wrapper {
  display: flex;
  justify-content: center;
  align-items: center;
}
::v-deep .el-dialog:not(.is-fullscreen) {
  margin-top: 0vh !important;
}
.myQuillEditor {
  // border:1px red solid;
  height: 500px;
}
.buttonstyle {
  margin: 90px 0px;
  width: 100px;
}
.inputWidth {
  // width: 310px;
  width: 100%;
}
.app-container {
  .title {
    padding: 0px 0px 6px 0px;
    margin: 5px 0px 13px 0px;
    height: 50px;
    border-bottom: 1px solid #eee;
    display: flex;
    align-items: center;
    // border: 1px red solid;
    img {
      height: 30px;
      margin-right: 10px;
    }
  }
}
.topDiv {
  padding: 0px 20px;
  overflow: hidden;
  height: auto;
  box-shadow: 0 5px 20px rgba(0, 0, 0, 0.2);
  border-radius: 5px;

  .poR {
    position: relative;
    .poA {
      position: absolute;
      left: 50%;
      bottom: -30px;
      transform: translateX(-50%);
    }
    .poDiv {
      border: 1px solid #40a0ff00;
      border-radius: 5px;
      padding: 15px;
      .poImg {
        width: 100%;
      }
    }
    .isActive {
      border: 1px solid #409eff;
    }
  }
  .textData {
    background-color: rgb(245, 245, 245);
    padding: 20px;
    border-radius: 7px;
    .colDiv {
      background-color: rgb(252, 252, 252);
      border: 1px solid rgb(230, 230, 230);
      padding: 20px;
    }
  }
}
</style>
